# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{
    'variables': {
         'out_dir': '<(SHARED_INTERMEDIATE_DIR)/proto',
         'in_dir': '.'
    },
    'includes': [
         '../../configure.gypi',
    ],
    'targets': [
    {
        'target_name': 'seven_summits_proto',
            'type': 'static_library',
            'sources': [
                # generated by protoc action below
                '<(out_dir)/seven_summits.pb.h',
                '<(out_dir)/seven_summits.pb.cc'
                ],
            'actions': [
            {
                'action_name': 'protoc',
                'inputs': [
                    'seven_summits.proto',
                ],
                'outputs': [
                    '<(out_dir)/seven_summits.pb.h',
                    '<(out_dir)/seven_summits.pb.cc'
                    ],
                'action': [
                    '<(protoc)',
                    '--proto_path=<(in_dir)',
                    '--cpp_out=<(out_dir)',
                    '<@(_inputs)'
                    ]
            }],
            'link_settings': {
                'libraries': [
                    '-lprotobuf',
                    '-lpthread',
                ],
            },
            'direct_dependent_settings': {
                'include_dirs': [
                    '<(SHARED_INTERMEDIATE_DIR)',
                ]
            }
    }],
}
